import request from '@/utils/request'

export function getPage(query) {
  return request({
    url: '/web-api/business/maintenance/selectMaintenanceList',
    method: 'get',
    params: query
  })
}

export function addMaintenance(data) {
  return request({
    url: '/web-api/business/maintenance/addMaintenance',
    method: 'post',
    data
  })
}

/**
 *enterpriseId  projectDepartmentId  outletId
 * @param data
 * @returns {AxiosPromise}
 */
export function selectThreeInfoByCd(data) {
  return request({
    url: '/web-api/business/maintenance/selectThreeInfoByCd',
    method: 'get',
    params: data
  })
}

export function selectTMaintenanceDetailsDto(query) {
  return request({
    url: '/web-api/business/maintenance/selectTMaintenanceDetailsDto',
    method: 'get',
    params: query
  })
}
export function selectFormTempByCd(query) {
  return request({
    url: '/web-api/business/maintenance/selectFormTempByCd',
    method: 'get',
    params: query
  })
}

export function saveTMaintenanceDetailsDto(data) {
  return request({
    url: '/web-api/business/maintenance/saveTMaintenanceDetailsDto',
    method: 'post',
    data
  })
}

export function updateTMaintenance(data) {
  return request({
    url: '/web-api/business/maintenance/updateTMaintenance',
    method: 'post',
    data
  })
}

export function editEvaluation(data) {
  return request({
    url: '/web-api/business/maintenance/editEvaluation',
    method: 'post',
    data
  })
}

export function selectEvaluation(query) {
  return request({
    url: '/web-api/business/maintenance/selectEvaluation',
    method: 'get',
    params: query
  })
}

export function selectTMaintenanceFormTemp(query) {
  return request({
    url: '/web-api/business/maintenance/selectTMaintenanceFormTemp',
    method: 'get',
    params: query
  })
}

export function saveCheck(data) {
  return request({
    url: '/web-api/business/maintenance/saveCheck',
    method: 'post',
    data
  })
}

export function downloadPic(query) {
  return request({
    url: '/web-api/business/maintenance/downloadPic',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

export function getList() {
  return request({
    url: '/web-api/business/maintenance/dict',
    method: 'get'
  })
}
export function selectMaintenanceFormDetails() {
  return request({
    url: '/web-api/business/maintenance/selectMaintenanceFormDetails',
    method: 'get'
  })
}
export function updateMaintenanceStatus(ids) {
  return request({
    url: '/web-api/business/maintenance/status/' + ids,
    method: 'put'
  })
}
export function selectLastMaintenance2(query) {
  return request({
    url: '/web-api/business/maintenance/selectLastMaintenance2',
    method: 'get',
    params: query
  })
}
export function del(ids) {
  return request({
    url: '/web-api/business/maintenance/' + ids,
    method: 'delete'
  })
}
